﻿using System;
using System.Windows;
using System.Collections;
using Alex.DataLibrary.Enums;

namespace Alex.WPFLibrary
{
    /// <summary>
    /// Логика взаимодействия для TablesTypeDis.xaml
    /// </summary>
    public partial class TablesTypeDis : Window
    {
        public TablesTypeDis()
        {
            InitializeComponent();
        }

        private void comboType_DropDownClosed(object sender, EventArgs e)
        {
            switch (comboType.SelectedIndex)
            {
                case 0:
                    expanderList.IsExpanded = true;
                    expanderList.IsEnabled = true;
                    break;
                case 1:
                    expanderList.IsExpanded = false;
                    expanderList.IsEnabled = false;
                    break;
            }
        }

        private void createButton_Click(object sender, RoutedEventArgs e)
        {
            switch (comboType.SelectedIndex)
            {
                case 0:
                    TypeOfTables = (int)TableType.Standart;
                    break;
                case 1:
                    TypeOfTables = (int)TableType.Compare;
                    break;
            }

            this.Close();
        }

        public int TypeOfTables
        {
            private set;
            get;
        }

        public ArrayList ColumnListView
        {
            get { return listCreator.ColumnListView; }
        }

        public string LabelTextBox
        {
            set { listCreator.LabelTextBox = value; }
        }

        public string LabelListView
        {
            set { listCreator.LabelListView = value; }
        }
    }
}
